﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Faculty
{
    class Department
    {
        public string Name;
        public List<Group> Groups = new List<Group>();
        private static int departmentsCount;

        public static Department GenerateDepartment()
        {
            Department dep = new Department();
            dep.Name = "Department" + Department.departmentsCount;
            Department.departmentsCount++;

            for (int i = 0; i < 5; i++)
            {
                Group group = new Group();
                group.GenerateGroup();
                dep.Groups.Add(group);
            }
            return dep;
        }

        public void PrintDepartment()
        {
            Console.WriteLine("Department: {0}", Name);
            int i = 0;
            foreach (var group in Groups)
            {
                Console.WriteLine("{0} {1}", i, group.Name);
                i++;
            }
        }

        public void PrintStudents()
        {
            foreach (var group in Groups)
            {
                group.PrintStudentsToConsole();
            }
        }
    }
}
